package a01;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class Component01 {

    Logger logger = LoggerFactory.getLogger(Component01.class);

    @Autowired
    ApplicationContext context;

    public void register(){
        logger.info("用户注册");
        context.publishEvent(new UserRegisterEvent(this));
    }

}
